<!--会员查询-->
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>会员查询</title>
    <link rel="stylesheet" href="/hotel/css/layui.css">
    <link rel="stylesheet" href="/hotel/css/bootstrap.min.css">
    <link href="/hotel/css/bootstrap-datepicker3.min.css" rel="stylesheet"/>
    <link href="/hotel/css/bootstrap-datetimepicker.min.css" rel="stylesheet"/>
    <style>
        input{
            display: inline-block !important;
        }
        a:link{
            text-decoration:none;
        }
    </style>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">MISS后台管理系统</div>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <img src="http://t.cn/RCzsdCq" class="layui-nav-img">
                    username
                </a>
            </li>
            <li class="layui-nav-item"><a href="">注销</a></li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                <!-- 侧边导航: <ul class="layui-nav layui-nav-tree layui-nav-side"> -->
                <li class="layui-nav-item">
                    <a href="index.html">首页</a>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">散客开单</a>
                    <dl class="layui-nav-child">
                        <dd><a href="Guests_check_in.html">宾客入住</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">订单</a>
                    <dl class="layui-nav-child">
                        <dd><a href="Order.html">所有订单</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">宾客结账</a>
                    <dl class="layui-nav-child">
                        <dd><a href="Ordinary_invoicing.html">结账</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">预定管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="Query_book.html">查询预定</a></dd>
                        <dd><a href="Add_a_reservation.html">添加预定</a></dd>

                    </dl>
                </li>
                <li class="layui-nav-item layui-nav-itemed">
                    <a href="javascript:;">营业查询</a>
                    <dl class="layui-nav-child">
                        <dd><a href="Check-in_guest_enquiry.html">入住宾客查询</a></dd>
                        <dd><a href="Member_of_the_query.html" style="background-color: #1E90FF">会员查询</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">系统设置</a>
                    <dl class="layui-nav-child">
                        <dd><a href="Data_management.html">数据管理</a></dd>
                        <dd><a href="VIP_set_up.html">VIP设置</a></dd>
                        <dd><a href="Billing_Settings.html">计费设置</a></dd>
                        <dd><a href="Set_up_the_room.html">房间设置</a></dd>
                        <dd><a href="Operator_setup.html">操作员设置</a></dd>
                    </dl>
                </li>
                 <li class="layui-nav-item">
                    <a href="javascript:;">订单信息</a>
                    <dl class="layui-nav-child">
                    <dd><a href="javascript:void(0);" onclick="tan()">查看订单信息</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <div style="padding: 15px;">
            <h1>会员查询</h1><br/>
            <input type="text" class="form-control" placeholder="输入姓名搜索" style="width: 200px">
            <button class="layui-btn layui-btn-radius layui-btn-primary">查找</button>
            <br/>
            <table class="layui-table">
                <colgroup>
                    <col width="200">
                    <col width="200">
                    <col width="200">
                </colgroup>
                <thead>
                <tr>
                    <th>会员姓名</th>
                    <th>会员身份证</th>
                    <th>手机号码</th>
                </tr>
                </thead>
                <tbody id="tbody1">
                <tr>
                    <td>郑杰</td>
                    <td>510xxxxxxxxxxxxx</td>
                    <td>151xxxxxxx</td>
                </tr>
                </tbody>
            </table>
            <ul class="pagination" id="ulli">
			  <li><a href="#">&laquo;</a></li>
			  <li><a href="#">1</a></li>
			  <li><a href="#">2</a></li>
			  <li><a href="#">3</a></li>
			  <li><a href="#">4</a></li>
			  <li><a href="#">5</a></li>
			  <li><a href="#">&raquo;</a></li>
			</ul>
        </div>
    </div>
    <div class="layui-footer">
        <!-- 底部固定区域 -->
        © MISS酒店
    </div>
</div>
 <div class="modal fade" id="webSocketModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" >
  <div class="modal-dialog" style="height: 300px">
    <div class="modal-content" >
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="myModalLabel">订单信息</h4>
      </div>
      <div class="modal-body" style="height: 300px">
        <div class="form-group" style="float: left;"></br>
			 <textarea id="message_content" class="form-control" readonly="readonly" cols="80" rows="10"></textarea>
		</div>
       </div>
    </div>
  </div>
</div><!-- /.modal -->
<script src="/hotel/js/layui.all.js"></script>
<script src="/hotel/js/jquery.min.js"></script>
<script src="../bt/modal.js"></script>
<script>
fenye(1);
function tan(){
	$("#webSocketModal").modal('show')
}
function fenye(pageNum){
	$.ajax({
		url:"/user/"+pageNum+"/7",
		type:"get",
		async:true,
		dataType:"json",
		success:function(mes){
			console.info(mes)
			var list = mes.list;
			var str = "";
			var str1 = "<li><a onclick='prex("+mes.pageNum+")'>&laquo;</a></li>";
			for (var i = 0; i < list.length; i++) {
				str+="<tr><td>"+list[i].name+"</td><td>"+list[i].idCard+"</td><td>"+list[i].mobile+"</td></tr>";
			}
			$("#tbody1").html(str);
			for(var a = 1;a <= mes.pages;a++){
				if(a==mes.pageNum){
					str1+="<li style='background-color: #33AB9F'><a  onclick='fenye("+a+")'>"+a+"</a></li>";
				}else{
					str1+="<li style='background-color: #1E90FF'><a onclick='fenye("+a+")'>"+a+"</a></li>";
				}
				
			}
			str1+=" <li><a onclick='next("+mes.pageNum+","+mes.pages+")'>&raquo;</a></li>"
			$("#ulli").html(str1);
		}
	});
}
	function prex(page){
		if(page-1==0){
			alert("已经第一页了");
		}else{
			fenye(page-1);
		}
	}
	
	function next(page,totalpage){
		if(page+1>totalpage){
			page = totalpage;
			alert("已经最后一页");
		}else{
			fenye(page+1);
		}	
	}
	
	/* function firstPageFenye(type){
		//第一次请求，
		type = $("#type").val();
		fenye(1,10,type);
	} */
	
	/* function lastPageFneye(totalpage){
		type = $("#type").val();
		fenye(totalpage,10,type);
	} */
</script>
<script type="text/javascript">

var websocket = null;
//浏览器是否支持
if ('WebSocket' in window) {
  // 上面我们给webSocket定位的路径
  websocket = new WebSocket('ws://192.168.3.103:8080/webSocket');
} else {
  alert('该浏览器不支持websocket!');
}
//建立连接
websocket.onopen = function (event) {
  console.log('建立连接');
				
}
//关闭连接
websocket.onclose = function (event) {
  console.log('连接关闭');
}
//消息来的时候的事件
websocket.onmessage = function (event) {
  // 这里event.data就是我们从后台推送过来的消息
  console.log('收到消息:' + event.data);
  $('#message_content').append(event.data+'\n');
  // 在这里我们可以在页面中放置一个音乐，例如“您有新的订单了！”这样的提示音
  	document.getElementById("myAudio").play();
}

//发生错误时
websocket.onerror = function () {
  alert('websocket通信发生错误！');
}
//窗口关闭时，Websocket关闭
window.onbeforeunload = function () {
  websocket.close();
}

</script>
<audio src="../video/dingdong.mp3"  id="myAudio" ></audio>
</body>
</html>